SET(TARGET_NAME "wx")
SET(TARGET_DIR bin/${BIN_FOLDER}/modules/)

INCLUDE_DIRECTORIES(./)

INCLUDE_DIRECTORIES(../../include)

INCLUDE_DIRECTORIES(${WX_INC_DIR})
LINK_DIRECTORIES (${WX_LIB_DIR})

INCLUDE_DIRECTORIES(${LUA_INC_DIR})
LINK_DIRECTORIES (${LUA_LIB_DIR})

ADD_DEFINITIONS(${WX_FLAGS})
ADD_DEFINITIONS(-DSWIG_BINDINGS)

FILE(GLOB_RECURSE PUBLIC_HEADERS "../../include/*.h")

# WRITE_WX_HEADERS()
                                  
FILE(GLOB_RECURSE BINDING_FILES "*_wrap.cxx")

ADD_LIBRARY (${TARGET_NAME} SHARED ${PUBLIC_HEADERS} ${BINDING_FILES} )

ADD_PRECOMPILED_HEADER( ${TARGET_NAME} ../../include/plug_common.h) 

SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES 
	PREFIX ""
	SUFFIX ".sgp")
	
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${LUA_LIBS} ${WX_LIBS} ${FLAVOR_LIBS} ${GL_LIBS})  

INSTALL(TARGETS ${TARGET_NAME}
	RUNTIME DESTINATION ${TARGET_DIR}
	LIBRARY DESTINATION ${TARGET_DIR})
